package com.logic.UploadDatas;

import java.sql.CallableStatement;
import java.sql.Connection;
import java.sql.SQLException;

import com.context.db.DBContext;

public class UploadAndInsertDatasLogic {
	private static String rlt = null;


	public static String getRlt( String... args ){


		rlt = null;

		Connection conn = null;

		CallableStatement cst = null;

		conn = DBContext.getDBInstance( DBContext.MYSQL ).getDBConnection();

		try {
			cst = conn.prepareCall( "{call new_insert_user_datas_proc(?,?,?,?,?,?)}" );

			cst.setString( 1, args[0] );
			cst.setString( 2, args[1] );
			cst.setString( 3, args[2] );
			cst.setString( 4, args[3] );
			cst.setString( 5, args[4] );
			
			cst.registerOutParameter( 6, java.sql.Types.VARCHAR );
			
			cst.execute();
			
			rlt = cst.getString( 6 );
		} catch (SQLException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}finally{

			try {
				cst.close();

				cst = null;
			} catch (SQLException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}

		}

		return rlt;
	}



}
